﻿using System;
using System.Collections;

namespace csharpbiancheng_ch08_lise_example1
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList list = new ArrayList() { "aaa", "bbb", "ccc" };
            string tempstr = "ddd";
            string firststr = (string)list[0];

            foreach (var v in list)
            {
                Console.WriteLine(v);
            }

            list.RemoveAt(0);
            list.Add(tempstr);
            Console.WriteLine("----");
            Console.WriteLine(firststr);
            Console.WriteLine("----");
            foreach (var v in list)
            {
                Console.WriteLine(v);
            }
        }
    }
}
